#include "misc.h"
#include <cctype>
#include <cstdlib>
#include <cstring>

int find_delim(const char* a, int len) {
	int i=0;
	for (;i<len;i++) {
		if (ispunct(a[i]) && (a[i]!='-')) return i;
	};
};

int extract_int(const char* a, int &pos) {
  int i,j=0;
  char *tmp;
/*    j = find_delim(a, strlen(a));*/
  j = strtol(a, &tmp, 0);
  pos = tmp - a + 1;
  return j;
};

char* extract_str(const char* a, int len, int &pos) {
	char* str;
	str = new char[len];
	strncpy(str, a, len);
	pos = len + 1;
	return str;
};
